package org.dtrd.modules.archive.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.dtrd.config.system.Constant;
import org.dtrd.modules.archive.entity.po.DtrdEntRdArchiveLaboratory;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DtrdEntRdLaboratoryMapper extends BaseMapper<DtrdEntRdArchiveLaboratory> {

    Float getAvgTypeByType(@Param("patientId") Integer patientId,@Param("startDate") String startDate,@Param("endDate") String endDate,@Param("laboratory") Constant.LABORATORY laboratory);

    /**
     * 获取实验室对应检查的一条最初记录
     * @param patientId
     * @param laboratory
     * @return
     */
    Float getFirstLaboratoryValue(@Param("patientId") Integer patientId,@Param("laboratory") Constant.LABORATORY laboratory);

    /**
     * 获取周期内的实验室检查内容
     * @param patientId
     * @param startDate
     * @param endDate
     * @param laboratory
     * @return
     */
    List<DtrdEntRdArchiveLaboratory> getPeriodLaboratoryType(@Param("patientId") Integer patientId,@Param("startDate") String startDate,@Param("endDate") String endDate,@Param("laboratory") Constant.LABORATORY laboratory);
}